"use strict";
const bcrypt = require('bcrypt')
/** @type {import("sequelize-cli").Migration} */
module.exports = {
  async up (queryInterface, Sequelize) {
    const data = [
      {
        username: "xwxw",
        nickname: "小吴小吴",
        password: bcrypt.hashSync("123123", 10),
        introduce: "",
        email: "6576153221@qq.com",
        avatar: "",
        role: 100,
        sex: 1,
        phone: "15240021857",
        company: "小吴手机",
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        username: "xww",
        nickname: "大吴",
        password: bcrypt.hashSync("123456", 10),
        introduce: "",
        email: "15240021857@139.com",
        avatar: "",
        role: 0,
        sex: 0,
        phone: "15240021857",
        company: "大吴手机",
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        username: "xwww",
        nickname: "老吴",
        password: bcrypt.hashSync("123456", 10),
        introduce: "",
        email: "wrightwu@qtl.com",
        avatar: "",
        role: 100,
        sex: 0,
        phone: "15240021857",
        company: "老吴手机",
        createdAt: new Date(),
        updatedAt: new Date()
      }
    ]
    
    try {
      await queryInterface.bulkInsert("Users", data, {});
    } catch (error) {
      console.log("seed error", error);
    }
  },

  async down (queryInterface, Sequelize) {
     await queryInterface.bulkDelete("Users", null, {});
  }
};
